<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
    *{
        margin: 0;
        padding: 0;
    }
    #box{
        width: 200px;
        height: 200px;
        position: relative;
    }
    #box::before{
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 1px;
        background: #000;
    }
    @media screen and (-webkit-min-device-pixel-ratio :2){
        #box::before{
            transform: scaleY(0.5);
        }
    }
    @media screen and (-webkit-min-device-pixel-ratio :3){
        #box::before{
            transform: scaleY(0.333);
        }
    }
    </style>
</head>
<body>
    <div id="box"></div>
    <script type="text/javascript">
        window.onload=function()
        {
            window.devicePixelRatio;
        }
    </script>
</body>
</html>